<?php
if ($detail_commandes->num_rows() > 0) {
    $com = $detail_commandes->row();
    $pattern = '%d-%m-%Y';
    $date = mdate($pattern,$com->dat);
    $livre = mdate($pattern,$com->livre);
    $status = $com->status;
  
}

foreach ($transport as $aRow) {
    $array[$aRow['id']] = $aRow['nom'];
}

if($id_trans->num_rows()>0){
    $id_liv = $id_trans->row();
    $id = $id_liv->id;
}
?>
<div id="wrapper-content">
       <table class="titrepage" width="100%">
        <tr>
            <td >Information du commande</td>
        </tr>
    </table>

<?php echo form_open(site_url('commandes/detail_commandes') . '/' . $com->id); ?>
            <table  width="100%"  class="list">
                <tr>
                    <td colspan="2" align="left" style="color: blue;">Détail client</td>
                </tr>
                <tr>
                    <td width="35%"><label for="diplay_name">Client:</label></td>
                    <td><?php echo $com->display_name; ?></td>
                </tr>
                <tr>
                    <td><label for="name">Nom d'utilisateur:</label></td>
                    <td><?php echo $com->first_name. ' '.$com->last_name; ?></td>
                </tr>
                <tr>
                    <td><label for="phone">Téléphone:</label></td>
                    <td><?php echo $com->phone; ?></td>
                </tr>
                <tr>
                    <td><label for="email">Email:</label></td>
                    <td><?php echo $com->email; ?></td>
                </tr>
                <tr>
                    <td><label for="address">Adresse:</label></td>
                    <td><?php echo $com->address; ?></td>
                </tr>
                <tr>
                    <td colspan="2" align="left" style="color: blue;">Détail commande</td>
                </tr>
                <tr>
                    <td><label for="id_livraison">Livraison:</label></td>
                    <td><?php echo $array[$id]; ?></td>
                </tr>
                <tr>
                    <td><label for="dat">Dat:</label></td>
                    <td><?php echo $date; ?></td>
                </tr>
                <tr>
                    <td ><label for="livre">Livré:</label></td>
                    <td colspan="2">
                    <?php if($com->livre!=NULL){ echo $livre; }else{?>
                        <a class="supprimer" href="#" style="color: red">Pas encore livré</a>
                        <div style="display:none">
                                            Confirmer <br/>
                            <a href="<?php echo site_url('test/delivered') . '/' . $com->id.'/'.$com->user_id; ?>"> <img border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/oui.png"/></a>
                            <a class="non" href="#" ><img  border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/non.png"/></a>
                        </div>
                    <?php }?>
                    </td>
                </tr>
                <tr>
                    <td><label for="adr">Adresse de livraison:</label></td>
                    <td><?php echo $com->adr; ?></td>
                </tr>
                <tr>
                    <td><label for="montant">Montant:</label></td>
                    <td><?php echo $com->montant; ?></td>
                </tr>
                <tr>
                    <td><label for="nom">Paiement:</label></td>
                    <td><?php echo $com->nom; ?></td>
                </tr>
                <tr>
                    <td><label for="status">Status:</label></td>
                    <td style="color: red"><?php echo $com->status; ?></td>
                </tr>
                <tr>
                    <td colspan="2" style="color: blue">Liste produits</td>
                </tr>
                <?php for ($index=0;$index<count($detail_product);$index++) :?>
                <tr>
                    <td ><?php echo ($index+1).". ".$detail_product[$index]['nomfr']?></td>
                    <td ><?php echo $detail_product[$index]['quantite'].' * '. $detail_product[$index]['prix'].'€'; ?></td>
                </tr>
                <?php endfor;?>
            </table>
<?php echo form_close(); ?>
</div>